#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "led.h"
#include "key.h"
#include "OLED.h"
#include "CountSensor.h"
#include "Timer.h"
#include "PWM.h"
int main()
{
	uint16_t duty = 0;
	PWM_Init(RCC_APB2Periph_GPIOA, GPIOA, GPIO_Pin_0, GPIO_Mode_AF_PP, RCC_APB1Periph_TIM2, TIM2, TIM_CKD_DIV1, TIM_CounterMode_Up, 100 - 1, 
	720 - 1, 0, TIM_OCMode_PWM1, TIM_OCPolarity_High, 0, 0);
	while(1)
	{
		for(duty=0;duty<=100;duty++)
		{
			Duty_Change(TIM2, duty, 0);
			Delay_ms(10);
		}
		for(duty=0;duty<=100;duty++)
		{
			Duty_Change(TIM2, 100 - duty, 0);
			Delay_ms(10);
		}
	}
}
